package com.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.demo.common.excel.ExcelField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;

@Data
@TableName("student")
@AllArgsConstructor
@NoArgsConstructor
public class Student{

    @TableId(value = "id", type = IdType.AUTO)
    @ExcelField(useImport = false)
    private Integer id;

    @ExcelField
    private Integer age;

    @NotEmpty(message = "姓名不能为空")
    @ExcelField
    private String name;

    @NotBlank(message = "地址不能为空")
    @ExcelField
    private String address;
}